package com.common.interceptor;

import java.lang.reflect.Method;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.aop.MethodBeforeAdvice;

public class BeforeAdvice implements MethodBeforeAdvice {
	
	protected final Log logger = LogFactory.getLog(this.getClass());

	public void before(Method arg0, Object[] arg1, Object arg2)
			throws Throwable {
		String logStr = arg2.getClass().getName() + "." + arg0.getName() + "()";
		for (Object o : arg1) {
			logStr += logStr + "^" + o.toString();
		}
		logger.info(logStr);
	}

}
